#!/bin/bash

##HACKABOT_HELP##
# Get a random quote link from bash.org
# !bash [number]
##HACKABOT_HELP##

NUM=`perl -n -e 'print $1 if /^msg\s+(\d+)/'`

if [ "$NUM" == "" ]; then
	NUM="` lynx -dump "http://bash.org/?random1" | grep -m 1 "#[[:digit:]]" | perl -p -e 's/.*#(\d+).*/$1/'`"
fi

echo "send http://bash.org/?$NUM"
